<template>
  <el-container class="home-container">
    <!-- 头部区域 -->
    <el-header>
      <hm-header />
    </el-header>

    <el-container>
      <!-- 侧边栏区域 -->
      <el-aside :width="isCollapse? '64px' : '200px'">
        <div class="home-open-btn" @click="toggleCollapse">|||</div>
        <hm-aside :collapse="isCollapse" />
      </el-aside>
      
      <!-- 主体区域 -->
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import HmHeader from '../../components/HmHeader.vue';
import HmAside from '../../components/HmAside.vue';

const isCollapse = ref<Boolean>(false)

const toggleCollapse = () => {
  isCollapse.value = !isCollapse.value
}

</script>

<style lang="less" scoped>
.home-container {
  height: 100%;
}
.home-open-btn {
  text-align: center;
  color: #fff;
  cursor: pointer;
  background-color: #4a5064;
  letter-spacing: .2em;
  line-height: 24px;
  font-size: 10px;
}
.el-header {
  padding: 0;
}
.el-aside {
  height: 100%;
  background-color: #333744;
}
.el-main {
  background-color: #eaedf1;
}
</style>